const componentBehavior = require('../../../js/common/ComponentBehavior')

Component({
  properties: {
    data: {
      value: null,
      type: Object
    },
  },
  data: {
    pickerIndex: -1
  },
  behaviors: [componentBehavior],
  methods: {
    bindPickerChange(e) {
      let index = e.detail.value
      this.setData({
        pickerIndex: e.detail.value
      })
      let dataId = this.data.data.Id
      let value = this.data.data.ItemList[index].value
      this.triggerEvent("selectCallBack", {
        dataId: dataId,
        value: value
      });
    }
  }
})
